#ifndef __OMGW_APPLICATION_H
#define __OMGW_APPLICATION_H

#include <OgreRoot.h>

#include <OIS/OIS.h>
#include "SettingsManager.h"
#include "Session.h"

//forward class declarations
class EventListener;
class OMGCamera;

//global variables
extern SettingsManager gSettings;
extern Ogre::SceneManager* gSceneMgr;
extern OMGCamera* gCamera;

class Application
{
public:
    void go();

    ~Application();

private:
    Ogre::Root *mRoot;
    OIS::Keyboard *mKeyboard;
    OIS::Mouse *mMouse;
    OIS::InputManager *mInputManager;
    //CEGUI::OgreCEGUIRenderer *mRenderer;
    //CEGUI::System *mSystem;
    EventListener *mListener;

    Session* mSession;

    void createRoot();
    void defineResources();
    void setupRenderSystem();
    void createRenderWindow();
    void initializeResourceGroups();
    void setupScene();
    void setupInputSystem();
    void setupCEGUI();
    void createFrameListener();
    void startRenderLoop();
};

#endif
